﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TCKQKL.FrontEnd.DataModel;
using TCKQKL.Service.LookupClient;
using System.Collections.Generic;

namespace TCKQKL.FrontEnd.Web.Controls
{
    public partial class StocksInfo : System.Web.UI.UserControl
    {
        //public List<HoldingDataUI> holding = new List<HoldingDataUI>();
        public List<AccountDataUI> holding = new List<AccountDataUI>();
        public bool assign = false;
        public decimal locked = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //LSClient client = new LSClient();
                //holding = client.getHolding(client.getAccountData(HttpContext.Current.User.Identity.Name).investorId);
                //foreach (HoldingDataUI item in holding)
                //    item.Account.tradingAmount = item.Account.tradingAmount - client.getLockedQuantity(item.Account.stockId);
                //client.Close();
                LSClient client = new LSClient();
                holding = client.getAccountByInvestorId(client.getAccountData(HttpContext.Current.User.Identity.Name).investorId);
                foreach (AccountDataUI item in holding)
                    item.tradingAmount = item.tradingAmount - client.getLockedQuantity(item.stockId);
                client.Close();

            }
            catch
            {
                return;
            }

        }
    }
}